<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>setTimeout()</title>
    
</head>
<body>
    <script type="text/javascript">
        // // 延迟性的操作 单位为毫秒
        // window.setTimeout(function(){
        //     console.log("my name")
        // }, 2000);
        // console.log("xiongda");

        var num = 1;
        var timer = setInterval(function(){
            console.log("Myname" + num);
            num++;
            if(num > 5){
                clearInterval(timer);
            }
        }, 1000);
    </script>
</body>
</html>